/**
 * 
 */
package com.gragra.wilsHandler;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
/**
 * @author Christoph Teichmann
 * 24.09.2013
 */
public class TransferCorpus
{
	/**
	 * first a prefix for the output files
	 * @param args
	 */
	public static void main(String[] args) throws IOException
	{
		String prefix = args[0];
		args = Arrays.copyOfRange(args, 1, args.length);
		Integer[] sizes = new Integer[] {10,15};
		for(Integer h : sizes)
		{
			BufferedReader[] arr = new BufferedReader[args.length];
			for(int i=0;i<arr.length;++i)
			{arr[i] = new BufferedReader(new FileReader(args[i]));}
			BufferedWriter gold = new BufferedWriter(new FileWriter(prefix+"_gold_"+h.toString()+".txt"));
			BufferedWriter coarse = new BufferedWriter(new FileWriter(prefix+"_coarse_"+h.toString()+".txt"));
			BufferedWriter universal = new BufferedWriter(new FileWriter(prefix+"_universal_"+h.toString()+".txt"));
			BufferedWriter fine = new BufferedWriter(new FileWriter(prefix+"_fine_"+h.toString()+".txt"));
			WilsToPunctuationFreeWithEvaluateSentences.main(gold, universal, coarse,fine, arr,h);
			gold.close();
			coarse.close();
			universal.close();
			fine.close();
			for(int i = 0; i < arr.length; i++)
			{arr[i].close();}
		}
		BufferedReader[] arr = new BufferedReader[args.length];
		for(int i=0;i<arr.length;++i)
		{arr[i] = new BufferedReader(new FileReader(args[i]));}
		BufferedWriter gold = new BufferedWriter(new FileWriter(prefix+"_gold.txt"));
		BufferedWriter coarse = new BufferedWriter(new FileWriter(prefix+"_coarse.txt"));
		BufferedWriter universal = new BufferedWriter(new FileWriter(prefix+"_universal.txt"));
		BufferedWriter fine = new BufferedWriter(new FileWriter(prefix+"_fine_.txt"));
		WilsToPunctuationFreeWithEvaluateSentences.main(gold, universal, coarse, fine, arr,-1);
		gold.close();
		coarse.close();
		universal.close();
		fine.close();
		for(int i = 0; i < arr.length; i++)
		{arr[i].close();}
	}
}